<template>
    <view class="container">
        <view class="title">
            {{ dataInfo.title }}
        </view>

        <view class="form-item">
            <view>{{dataInfo.read_num}}看过</view>
            <view> {{ dataInfo.create_time }}</view>
        </view>
        <view style="width: 750rpx;height: 1rpx;background: #333;"></view>
        <view class="content">
            <rich-text :nodes="dataInfo.content"></rich-text>
        </view>
     <!--   <video 
              src="https://rhwssz.rhwsdt.com/storage/upload_resource/20250811/e17698c8e220e92acd7b3ead04646e09.mp4"
              controls
              autoplay
              style="width: 100%;"
            ></video> -->
    </view>
</template>

<script>
    import {
        officialArticleReadnum
    } from "@/common/api/service-provider.js";
    import detailModule from "@/common/mixins/detail-module";
    import {
        imgBaseUrl,
        imgBaseUrlV2
    } from "@/common/config";
    import Upload from "@/components/public/upload";
    import {
        stringToJSON
    } from "@/utils";
    export default {
        mixins: [detailModule],
        components: {
            Upload,
        },
        data() {
            return {
                imgBaseUrlV2,
                currentSwiper: 0,
                swipers: [],
                mixinViewOptions: {
                    getURL: "/getArticleDetail",
                    isPage: true,
                    isShowLoading: false,
                    reachBottom: false,
                    createdIsNeed: false,
                    pullDown: false,
                },
                dataInfo: {},
            };
        },
        methods: {
            fetchComplete(err, data = {}, res) {
                if (err) {
                
                    return;
                }
               let content = data.content || "";
               data.content = content
                 .split("\n")
                 .reduce((total, cur) => (total += `${cur}`));
                data.url = stringToJSON(data.url);
            },
            onChangeSwiper(e) {
                let current = e.detail.current;
                this.currentSwiper = current;
            },
            onClickSwipe(item) {
                uni.previewImage({
                    current: item,
                    urls: this.swipers,
                });
            },
            officialArticleReadnumClick(id){
                officialArticleReadnum({id:id})
                    .then((res) => {})
                    .catch(() => {});
            }
        },
        onLoad(q) {
            this.dataForm.id = q.id;
            if (!q.id) {
               
            }
            this.getDataInfo();
            this.officialArticleReadnumClick(q.id);
        },
    };
</script>

<style lang="stylus" scoped>
    .container {
        min-height: calc(100vh - var(--window-top));
        background: linear-gradient(180deg, #0D1523 0%, #102945 100%);
        padding-bottom: constant(safe-area-inset-bottom);
        padding-bottom: env(safe-area-inset-bottom);
        color: #fff;
    }
    .title {
        font-size: 28rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: bold;
        color: color-white;
        padding: 20rpx;
    }

    .form-item {
        display: flex;
        font-size: 28rpx;
        line-height: 42rpx;
        padding: 10rpx 24rpx;
        color: white;
        justify-content: space-between
    }
    
    .content{
        padding: 20rpx;
        color: #fff
    }
</style>